Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #1633

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Solution #1633

wants to merge 4 commits into from

Conversation

Ngayka
Copy link

@Ngayka Ngayka commented Dec 11, 2024

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code meets the task requirements and constraints effectively! 🎉 While there are some areas for improvement, such as handling potential name conflicts and ensuring the validity of names when setting wife and husband attributes, these do not critically impact the functionality. Keep up the great work, and consider these suggestions for future enhancements to make your code even more robust! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -1,8 +1,31 @@
class Person:
# write your code here
pass
people = {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The people dictionary is used to store instances of Person by name. This approach assumes that all names are unique, which might not be the case. Consider handling potential name conflicts or using a different identifier.

Comment on lines +26 to +29
if "wife" in one and one["wife"]:
person.wife = Person.people.get(one["wife"])
elif "husband" in one and one["husband"]:
person.husband = Person.people.get(one["husband"])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for setting wife and husband attributes assumes that the provided names are always valid and present in the Person.people dictionary. Consider adding error handling or validation to ensure that the names exist in the dictionary before accessing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants